import org.rsbot.script.methods.Calculations;
import org.rsbot.script.methods.Objects;
import org.rsbot.script.methods.Walking;
import org.rsbot.script.wrappers.RSArea;
import org.rsbot.script.wrappers.RSObject;
import org.rsbot.script.wrappers.RSTile;

class GuildRanger$4 extends GuildRanger.WalkToArea
{
  public void execute()
  {
    RSObject localRSObject = GuildRanger.access$2600(this.this$0).getNearest(new int[] { 2514 });
    if ((localRSObject != null) && (GuildRanger.access$2700(this.this$0).distanceBetween(localRSObject.getLocation(), GuildRanger.GameConstants.GUILD_DOOR_TILE) < 2.0D))
    {
      if (localRSObject.isOnScreen()) {
        if (localRSObject.doAction("Open"))
          this.this$0.sleep(this.this$0.random(1000, 2000));
      }
      else if (!GuildRanger.GameConstants.GUILD_DOOR_TILE.equals(GuildRanger.access$2800(this.this$0).getDestination()))
      {
        GuildRanger.access$2900(this.this$0).walkTo(GuildRanger.GameConstants.GUILD_DOOR_TILE);
      }
    }
    else super.execute();
  }

  public boolean isTargetValid()
  {
    return GuildRanger.access$3000(this.this$0);
  }
}